<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition template="template-without-sidebar.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:odr="http://java.sun.com/jsf/composite/odr"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="head">
        <link rel="stylesheet" type="text/css" href="resources/css/vtip.min.css" />
        <link rel="stylesheet" type="text/css" href="resources/css/jquery-ui-1.8.6.custom.css" />
        <script type="text/javascript" src="resources/js/vtip-min.js"></script>
        <script type="text/javascript" src="resources/js/searchableTable.js"></script>
        <script type="text/javascript" src="resources/js/jquery-ui-1.8.6.custom.min.js"></script>
    </ui:define>

    <ui:define name="pagetitle">
        <ice:outputText value="#{page['iteration.table.title']}" nospan="true" />
    </ui:define>

    <ui:define name="bodyBegin">
        <odr:deletePopup valid="#{relation.valid}"
                         message="#{form['table.deletion.iteration.text']}"
                         attribute="#{relationshipTypeTableController.relationshipTypeToDelete.relationshipType.name}"
                         removeMethod="#{relationshipTypeTableController.deleteRelationshipType}"/>
    </ui:define>

    <ui:define name="content">
        <ice:panelGroup rendered="#{relationshipTypeTableController.valid}" >
            <odr:breadcrumb breadCrumbSource="#{relationshipTypeTableController.navigationBar}" />
            <h1><h:outputText value="#{form['table.header.iteration']}"/></h1>
            <a href="#{relationshipTypeTableController.createRelationshipTypeLink}" ><img class="createConcernSymbol vtip" title="#{form['table.tooltip.create.iteration']}" src="resources/images/add.png" alt="#{common['create']}"/></a>

            <label for="searchInput" class="prefillValue" style="display: none">#{form['table.search.input']}</label>
            <input id="searchInput" onkeyup="doFilter(this, 'relationshipTypeList', false)" style="width: 200px;" class="prefill" onclick="return false;"/>
        </ice:panelGroup>

        <ice:form partialSubmit="true" rendered="#{relationshipTypeTableController.valid}">
            <table class="dataList" id="relationshipTypeList">
                <thead>
                    <tr>
                        <th style="width: 10%;">common</th>
                        <th style="width: 90%" >name</th>
                        <th colspan="2">actions</th>
                    </tr>
                </thead>
                <tbody>
                <ice:repeat value="#{relationshipTypeTableController.list}" var="item" id="relationshipTypeRepeat">
                    <tr class="parentRow group-#{item.relationshipType.id}">
                        <td style="border-bottom: none">
                            #{item.relationshipType.common}
                        </td>
                        <td>#{item.relationshipType.name}</td>

                    <ice:panelGroup rendered="#{!item.relationshipType.common}">
                        <td><a href="#{relationshipTypeTableController.getUpdateLink(item)}" ><img class="vtip" title="#{form['table.tooltip.edit']}" alt="#{common.edit}"
                                                                                                   src="resources/images/pencilSmall.png"
                                                                                                   width="14"
                                                                                                   height="14"/></a></td>

                        <td><ice:commandLink value=""
                                             actionListener="#{relationshipTypeTableController.showDeleteRelationshipTypeConfirmation(e)}"
                                             styleClass="columnNavigationLink">
                            <img class="vtip" title="#{form['table.tooltip.delete']}" alt="#{common.remove}"
                                 src="resources/images/removeSmall.png"
                                 width="14"
                                 height="14"/>
                            <f:attribute value="#{item}" name="relationshipTypeitem" />
                            <f:attribute value="#{item.relationshipType}" name="relationshipType" />

                        </ice:commandLink></td>
                    </ice:panelGroup>
                    <ice:panelGroup rendered="#{item.relationshipType.common}">
                        <td></td>
                        <td></td>
                    </ice:panelGroup>

                    </tr>
                </ice:repeat>
                </tbody>
            </table>
        </ice:form>
    </ui:define>
</ui:composition>